<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>Fast Develop Designer</title>
    
    <link rel="stylesheet" href="./compoment/amis/sdk.css" />
    <link rel="stylesheet" href="./compoment/amis/iconfont.css" />
    <link rel="stylesheet" href="./compoment/@ztree/ztree_v3/css/demo.css">
    <link rel="stylesheet" href="./compoment/@ztree/ztree_v3/css/zTreeStyle/zTreeStyle.css">
    <link rel="stylesheet" href="./compoment/layui/dist/css/layui.css">
    <!--jQuery dependencies-->
    <link rel="stylesheet" href="./compoment/jquery-ui/jquery-ui.css" />
    <script src="./compoment/jquery/jquery.min.js"></script>
    <!-- <script src="./compoment/jquery/jquery-1.4.4.min.js"></script> -->
    <script src="./compoment/jquery-ui/jquery-ui.min.js"></script>
    <!--PQ Grid files-->
    <link rel="stylesheet" href="./compoment/jqgrid/pqgrid.min.css" />
    <script src="./compoment/jqgrid/pqgrid.min.js"></script>
    <!--PQ Grid Office theme-->

    <link rel="stylesheet" href="./compoment/jqgrid/themes/bootstrap/pqgrid.css" />
    <link rel="stylesheet" href="./css/all.min.css">

</head>
<!--<body>-->
<body class="">

<div id="app" class="layui-layout layui-layout-admin content"/>

<script src="./compoment/amis/sdk.js"></script>

<script src="./compoment/layui/dist/layui.js"></script>
<!-- <script type="text/javascript" src="./compoment/@ztree/ztree_v3/js/jquery-1.4.4.min.js"></script> -->
<script type="text/javascript" src="./compoment/@ztree/ztree_v3/js/jquery.ztree.core.js"></script>
<script type="text/javascript" src="./compoment/@ztree/ztree_v3/js/jquery.ztree.extend.js"></script>
<script type="text/javascript" src="./compoment/ajax-hook/dist/ajaxhook.min.js"></script>

<script src="./js/fastDevelop.js"></script>

<script id="domainModelForm" type="text/html">
    <form class="layui-form" action="" style="display: block;" id="form-data" lay-filter="data-form">
        <div class="layui-form-item">
            <label class="layui-form-label">Name</label>
            <div class="layui-input-block">
                <input type="text" lay-ignore name="name" lay-verify="name" autocomplete="off" placeholder="" required class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">Table</label>
            <div class="layui-input-block">
                <input type="text" lay-ignore name="tableName" lay-verify="tableName" autocomplete="off" placeholder="" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">Description</label>
            <div class="layui-input-block">
                <textarea name="comment" lay-ignore placeholder="" class="layui-textarea"></textarea>
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-input-block">
                <button type="submit" lay-ignore class="layui-btn layui-btn-sm layui-btn-normal" lay-submit="" lay-filter="*">Save</button>
            </div>
        </div>
    </form>
</script>

<script id="domainModelFieldForm" type="text/html">

    <form class="layui-form" action="" style="display: block;" id="form-data" lay-filter="data-form">
        <div class="layui-form-item">
            <label class="layui-form-label">Name</label>
            <div class="layui-input-block">
                {{#  if(d.type.metaType === 'domain_file_field_primary_key'){ }}
                <input type="text" name="name" lay-ignore lay-verify="name" readonly autocomplete="off" placeholder="" required class="layui-input">

                {{#  }else{ }}
                <input type="text" name="name" lay-ignore lay-verify="name" autocomplete="off" placeholder="" required class="layui-input">
                {{#  } }}

            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">Type</label>
            <div class="layui-input-block">
                <div class="layui-input-inline" style="width: 100px;">
                    {{#  if(d.type.metaType === 'domain_file_field_primary_key'){ }}
                    <select name="catalog" lay-verify="" disabled>
                        <option value="basic">Basic</option>
                    </select>

                    {{#  }else{ }}
                    <select name="catalog" lay-verify="">
                        <option value="basic">Basic</option>
                    </select>
                    {{#  } }}


                </div>
                <div class="layui-input-inline" style="width: 160px; margin-right: 0px;">
                    {{#  if(d.type.metaType === 'domain_file_field_primary_key'){ }}
                    <select name="type" lay-verify="" disabled>
                        <option value="string">String</option>
                        <option value="integer">Integer</option>
                        <option value="double">Double</option>
                        <option value="date">Date</option>
                        <!--<option value="Image">Image</option>-->
                        <option value="text">Text</option>
                        <!--<option value="File">File</option>-->
                    </select>

                    {{#  }else{ }}
                    <select name="type" lay-verify="">
                        <option value="string">String</option>
                        <option value="integer">Integer</option>
                        <option value="double">Double</option>
                        <option value="date">Date</option>
                        <!--<option value="Image">Image</option>-->
                        <option value="text">Text</option>
                        <!--<option value="File">File</option>-->
                    </select>
                    {{#  } }}

                </div>
            </div>

        </div>



        <div class="layui-form-item">
            <label class="layui-form-label">Length</label>
            <div class="layui-input-block">
                {{#  if(d.type.metaType === 'domain_file_field_primary_key'){ }}
                <input type="text" name="length" lay-ignore  lay-verify="number" readonly autocomplete="off" placeholder="" class="layui-input">

                {{#  }else{ }}
                <input type="text" name="length" lay-ignore  lay-verify="number" autocomplete="off" placeholder="" class="layui-input">
                {{#  } }}

            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">Column</label>
            <div class="layui-input-block">
                <input type="text" name="columnName" lay-ignore lay-verify="columnName" autocomplete="off" placeholder="" class="layui-input">
            </div>
        </div>


        <div class="layui-form-item">
            <label class="layui-form-label">Description</label>
            <div class="layui-input-block">
                <textarea name="comment" lay-ignore placeholder="" class="layui-textarea"></textarea>
            </div>
        </div>


        <div class="layui-form-item">
            <div class="layui-input-block">
                <button type="submit" class="layui-btn layui-btn-sm layui-btn-normal" lay-submit="" lay-filter="*">Save</button>
            </div>
        </div>

    </form>


</script>


<script>



    layui.use(['editor', 'amis', 'ztree', 'fast_config', 'app','utils','drag'], function() {
        console.log(layui.config())

        let utils = layui.utils,
            fast_config = layui.fast_config,
            app = layui.app;

        let conf_str = utils.stringformat(JSON.stringify(fast_config),utils.getGlobalEnv());
        fast_config = JSON.parse(conf_str);



        app.render({
            elem: '#app',
            contentSettings:{
                enableConsole: true,
                editorSettings: {
                    resource_trees_settings: [
                        {
                            elem: "#resource",
                            contentElem: '#fast-body',
                            enableRootPath:true,
                            api: fast_config.moudle.tree.main.url,
                            viewMode:'tabs',
                            icon: 'resource',
                            title: '&nbsp&nbsp&nbspData&nbsp&nbsp&nbsp',
                            schemaType: fast_config.moudle.tree.main.schemaType
                        },
                        {
                            elem: "#page_resource",
                            contentElem: '#fast-body',
                            enableRootPath:true,
                            api: fast_config.moudle.tree.second.url,
                            viewMode:'tabs',
                            icon: 'workflow',
                            title: '&nbsp&nbsp&nbspPage&nbsp&nbsp&nbsp',
                            schemaType: fast_config.moudle.tree.main.schemaType
                        }
                    ],
                    
                },
                enav_setting:{
                    elem:'#header-left',
                    data:[]
                },
                publish_settings: {
                    elem: '.header-center',
                }
            },
            headerSettings:{
                publishSettings: {

                    api: fast_config.moudle.publishApi
                }
            }
        })

        //
        // app.render({
        //     editorSetting: {
        //         elem: '#editor',
        //         consoleSetting: {
        //             elem: '#console-content'
        //         },
        //         resource_trees_settings: [
        //             {
        //                 elem: "#resource",
        //                 contentElem: '#fast-body',
        //                 enableRootPath:true,
        //                 api: fast_config.moudle.tree.main.url,
        //                 viewMode:'tabs',
        //                 icon: 'resource',
        //                 title: '&nbsp&nbsp&nbspData&nbsp&nbsp&nbsp',
        //                 schemaType: fast_config.moudle.tree.main.schemaType
        //             }
        //             , {
        //                 elem: "#page_resource",
        //                 contentElem: '#fast-body',
        //                 enableRootPath:true,
        //                 api: fast_config.moudle.tree.second.url,
        //                 viewMode:'tabs',
        //                 icon: 'workflow',
        //                 title: '&nbsp&nbsp&nbspPage&nbsp&nbsp&nbsp',
        //                 schemaType: fast_config.moudle.tree.main.schemaType
        //             }
        //         ],
        //         publish_settings: {
        //             elem: '.header-center',
        //             api: fast_config.moudle.publishApi
        //         },
        //         enav_setting:{
        //             elem:'#header-left',
        //             data:[]
        //         }
        //     }
        // })


    })





</script>

</body>
</html>